package com.bbtree.springmvc;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class RedisCommandUtil {
	

	  // inject the template as ListOperations
    @Resource(name="stringRedisTemplate")
    private ListOperations<String, String> listOps;
	 
	public void AddLink(){
		listOps.leftPush("test", "hello!");
	}
	
	public String getValue(){
		return listOps.leftPop("test");
	}
}
